<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            margin: 100 auto;
            width: 416px;
            border: 2px solid #000;
        }
        .btn{
            width: 416px;
            /* height: 100px; */
        }
        .list{
            width: 100px;
            height: 50px;
        }
        .active{
            background-color: lawngreen;
            /* border: none; */
        }
        .con{
            width: 410px;
            height: 410px;
            font-size: 60px;
            text-align: center;
            line-height: 416px;
            color: red;
            border: 3px solid #ccc;
            display: none;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="btn">
            <input type="button" class="list active" value="体育">
            <input type="button" class="list " value="娱乐">
            <input type="button" class="list " value="新闻">
            <input type="button" class="list " value="教育">
        </div>
        <div class="con" style="display: block;">体育</div>
        <div class="con">娱乐</div>
        <div class="con">新闻</div>
        <div class="con">教育</div>
    </div>


    <script>
        var btns = document.getElementsByTagName('input')
        var con = document.getElementsByClassName('con')
        for(var i = 0 ; i < btns.length ; i++){
            btns[i].idx = i;
            btns[i].onclick = function(){
                for(var j = 0;j < btns.length;j++){
                    btns[j].className = 'list'
                    con[j].style.display = 'none';
                }
                this.className = 'list active'
                con[this.idx].style.display = 'block';
            }
        }
    </script>
</body>
</html>